//
// Created by root on 6/29/17.
//

#include <stdlib.h>
#include "constants.h"


void init_constants() {
    G_NIL = (Cell *)malloc(sizeof(Cell));
    G_EOF = (Cell *)malloc(sizeof(Cell));
    G_TRUE = (Cell *)malloc(sizeof(Cell));
    G_FALSE = (Cell *)malloc(sizeof(Cell));

    G_NIL->_flag = REF_MARK;
    G_NIL->_type = NULL;
    G_NIL->_name = NULL;
    G_NIL->_pair._car = G_NIL->_pair._cdr = G_NIL;
    G_EOF->_flag = REF_MARK;
    G_EOF->_type = NULL;
    G_EOF->_name = NULL;
    G_EOF->_pair._car = G_EOF->_pair._cdr = G_EOF;
    G_TRUE->_flag = REF_MARK;
    G_TRUE->_type = BOOLEAN_TYPE;
    G_TRUE->_name = NULL;
    G_TRUE->_pair._car = G_TRUE->_pair._cdr = G_TRUE;
    G_FALSE->_flag = REF_MARK;
    G_FALSE->_type = BOOLEAN_TYPE;
    G_FALSE->_name = NULL;
    G_FALSE->_pair._car = G_FALSE->_pair._cdr = G_FALSE;
}

